<?php
	$natives = get_entities("object",'pel',$_SESSION['user']->getGUID());
  foreach($natives as $native){
    $native=get_entity($native->guid);
    $title_label= elgg_echo('pel:native')." :";
    $pel=ucfirst($native->description);
		$pel= '<h4><img src="'.$vars['url'].'mod/pel/graphics/owner_block_menu_arrow.gif" alt="owner block menu" />'.'  '.$pel.'</h4>';
  }
  $pelParent= $_SESSION['user']->getObjects('pel');
  //test affichage entities
  $edit=elgg_echo('pel:editlang');
  $delete=elgg_echo('pel:deletelang');
  $voir=elgg_echo('pel:voir');
  $ent=get_entities_from_metadata('parent_guid',$pelParent[0]->getGUID(),"object",'lang');
  $otherlang=elgg_echo('pel:user:nolang');

	if(is_array($ent))
	{
		foreach($ent as $e){
			$otherlang=elgg_echo('pel:otherlang');
			$entity=get_entity($e->guid);
			$guid=$entity->guid;
			$lang=ucfirst($entity->description);
			$text.="<tr><td><img src=\"".$vars['url']."mod/pel/graphics/owner_block_menu_arrow.gif\" alt=\"owner block menu\" /></td><td><h4>$lang</h4></td>
			<td><a href=\"".$vars['url']."mod/pel/viewlang.php?lang=$guid\"><img src=\"".$vars['url']."mod/pel/graphics/voir.gif\" alt=\"voir\" /> $voir</a></td>
			<td><a href=\"".$vars['url']."mod/pel/editlang.php?guid=$guid\"><img src=\"".$vars['url']."mod/pel/graphics/iconEdit.gif\" alt=\"editer\" /> $edit</a></td>
			<td><a href=\"".$vars['url']."mod/pel/deletelang.php?guid=$guid\"><img src=\"".$vars['url']."mod/pel/graphics/iconDelete.gif\" alt=\"supprimer\" /> $delete</a></td></tr>";
		}
	}
	else{
		$otherlang=elgg_echo('pel:otherlang');
		$text=elgg_echo('pel:user:nolang');
	}
?>

<div class="pel">
	<p>
		<h3><?php echo $title_label; ?></h3>
		<?php echo $pel; ?>
	</p>
	<p>
		<h3><?php echo $otherlang ; ?>: </h3>
	</p>
	<p>
		<table id="tablang">
			<?php echo $text; ?>
		</table>
	</p>
</div>	